package main

import (
	"bufio"
	"os"
	"strings"
)

func ConfigInit()map[string]string{
	ConfigList := make(map[string]string)
	file,_ := os.Open(".\\config.txt")
	defer file.Close()
	reader := bufio.NewReader(file)
	for {
		configR, _,err := reader.ReadLine()
		configread := string(configR)
		if err != nil{
			break
		}
		if strings.Contains(configread, "=") {
			splitstring := strings.Split(configread, "=")
			configkey := strings.TrimSpace(splitstring[0])
			configvalue := strings.TrimSpace(splitstring[1])
			ConfigList[configkey] = configvalue
		}
	}
	return ConfigList
}
